﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="VideosAdd.aspx.vb" Inherits="Assignment_2___Prototype.VideosAdd" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .st
        {
            font-size: medium;
        .style2
        {
            color: #3399FF;
        }
        .style3
        {
            font-size: x-large;
        }
        .style4
        {
            font-size: medium;
            color: #3399FF;
        }
        .guide
        {
            color: #696969;
        }
        .style5
        {
            color: #696969;
            font-size: small;
        }
        .style6
        {
            color: #FF0000;
        }
        .newVideoObjects
        {
            height: 1304px;
        }
        .listOfNewVideos
        {
            height: 1118px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <br />
    <h1>Youtube Videos</h1> <br />
    <br />
    <div class="style4">
        <strong>Instructions</strong> - Post Youtube Video Key in the text box below to 
        Add a new video.</div>
    <br />
    <div class="newVideoObjects">
        <strong>&nbsp; Youtube Video Key:</strong><br />
        &nbsp;
        <asp:TextBox ID="txtvideid" runat="server" Font-Names="Calibri" Width="221px"></asp:TextBox>
        <br />
        <br />
        <strong>&nbsp; Video Title:<br />
            &nbsp;
            <asp:TextBox ID="txtvideotitle" runat="server" Font-Names="Calibri" Width="288px"></asp:TextBox>
            <br />
            <br />
            &nbsp; Video Description:<br />
            &nbsp;
            <asp:TextBox ID="txtvideodescription" runat="server" Font-Names="Calibri" Height="61px"
                TextMode="MultiLine" Width="374px"></asp:TextBox>
            &nbsp;
            <asp:Button ID="btnAddVideo" runat="server" Text="Add Video" Width="115px" 
            CssClass="buttons" />
            <br />
            <br />
        </strong>
        <div class="listOfNewVideos">
            <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
                <AlternatingItemTemplate>
                    <strong>Title:</strong> <a href="VideosPlayComments.aspx?id=<%# Eval("VideoID") %>">
                        <%# Eval("VideoTitle") %></a>
                    <br />
                    <strong>Description:</strong>
                    <asp:Label ID="VideoDescriptionLabel" runat="server" Text='<%# Eval("VideoDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel" runat="server" Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel" runat="server" Text='<%# Eval("TimeUploaded") %>' />
                    <br />
                    <strong>Video Posted by:</strong> <a href="MyVolkswagen.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <br />
                    </span>
                </AlternatingItemTemplate>
                <EditItemTemplate>
                    <span style=""><strong>Title:</strong> <a href="VideosPlayComments.aspx?id=<%# Eval("VideoID") %>">
                        <%# Eval("VideoTitle") %></a>
                        <br />
                        <strong>Description:</strong>
                        <asp:TextBox ID="VideoDescriptionTextBox" runat="server" Text='<%# Bind("VideoDescription") %>' />
                        <br />
                        <strong>Date Uploaded:</strong>
                        <asp:TextBox ID="DateUploadedTextBox" runat="server" Text='<%# Bind("DateUploaded") %>' />
                        <br />
                        <strong>Time Uploaded:</strong>
                        <asp:TextBox ID="TimeUploadedTextBox" runat="server" Text='<%# Bind("TimeUploaded") %>' />
                        <br />
                        <strong>Video Posted by:</strong> <a href="MyVolkswagen.aspx?Username=<%# Eval("UserName") %>">
                            <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                        <br />
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                        <br />
                        <br />
                    </span>
                </EditItemTemplate>
                <EmptyDataTemplate>
                    <span>No Videos added.</span>
                </EmptyDataTemplate>
                <InsertItemTemplate>
                    <span style=""><strong>Title:</strong> <a href="VideosPlayComments.aspx?id=<%# Eval("VideoID") %>">
                        <%# Eval("VideoTitle") %></a>
                        <br />
                        <strong>Description:</strong>
                        <asp:TextBox ID="VideoDescriptionTextBox" runat="server" Text='<%# Bind("VideoDescription") %>' />
                        <br />
                        <strong>Date Uploaded:</strong>
                        <asp:TextBox ID="DateUploadedTextBox" runat="server" Text='<%# Bind("DateUploaded") %>' />
                        <br />
                        <strong>Time Uploaded:</strong>
                        <asp:TextBox ID="TimeUploadedTextBox" runat="server" Text='<%# Bind("TimeUploaded") %>' />
                        <br />
                        <strong>Video Posted by:</strong> <a href="MyVolkswagen.aspx?Username=<%# Eval("UserName") %>">
                            <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                        <br />
                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                        <br />
                        <br />
                    </span>
                </InsertItemTemplate>
                <ItemTemplate>
                    <strong>Title:</strong> <a href="VideosPlayComments.aspx?id=<%# Eval("VideoID") %>">
                        <%# Eval("VideoTitle") %></a>
                    <br />
                    <strong>Description:</strong>
                    <asp:Label ID="VideoDescriptionLabel" runat="server" Text='<%# Eval("VideoDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel" runat="server" Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel" runat="server" Text='<%# Eval("TimeUploaded") %>' />
                    <br />
                    <strong>Video Posted by:</strong> <a href="MyVolkswagen.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <br />
                    </span>
                </ItemTemplate>
                <LayoutTemplate>
                    <div id="itemPlaceholderContainer" runat="server" style="">
                        <span runat="server" id="itemPlaceholder" />
                    </div>
                    <div style="">
                        <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="10">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
                                    ShowPreviousPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
                                    ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </div>
                </LayoutTemplate>
                <SelectedItemTemplate>
                    <span style=""><strong>Title:</strong> <a href="VideoPlay.aspx?id=<%# Eval("VideoID") %>">
                        <%# Eval("VideoTitle") %></a>
                        <br />
                        <strong>Description:</strong>
                        <asp:Label ID="VideoDescriptionLabel" runat="server" Text='<%# Eval("VideoDescription") %>' />
                        <br />
                        <strong>Date Uploaded:</strong>
                        <asp:Label ID="DateUploadedLabel" runat="server" Text='<%# Eval("DateUploaded") %>' />
                        <br />
                        <strong>Time Uploaded:</strong>
                        <asp:Label ID="TimeUploadedLabel" runat="server" Text='<%# Eval("TimeUploaded") %>' />
                        <br />
                        <strong>Video Posted by:</strong> <a href="MyVolkswagen.aspx?Username=<%# Eval("UserName") %>">
                            <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                        <br />
                        <br />
                    </span>
                </SelectedItemTemplate>
            </asp:ListView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT Videos.VideoID, Videos.VideoLink, Videos.VideoTitle, Videos.VideoDescription, Videos.DateUploaded, Videos.TimeUploaded, aspnet_Users.UserName FROM (aspnet_Users INNER JOIN Videos ON aspnet_Users.UserId = Videos.UsernameID) ORDER BY Videos.VideoID DESC">
            </asp:SqlDataSource>
        </div>
    </div>
    <br />
</asp:Content>
